package com.group.activity.controller;



import com.github.pagehelper.PageInfo;
import com.group.activity.vo.BargainGoodsVo;
import com.group.activity.vo.BargainQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.group.activity.entity.BargainGoodsEntity;
import com.group.activity.service.BargainGoodsService;
import com.group.common.utils.R;

import java.text.ParseException;


/**
 * 砍价商品表
 *
 * @author gxx
 */
@RestController
@RequestMapping("activity/bargaingoods")
public class BargainGoodsController {
    @Autowired
    private BargainGoodsService bargainGoodsService;




    /*
    * 后台砍价商品列表
    * */
    @RequestMapping("bargainGoodsList")
    public R bargainGoodsList(@RequestBody BargainQueryVo bargainQueryVo){
        PageInfo<BargainGoodsVo> pageInfo=bargainGoodsService.bargainGoodsList(bargainQueryVo);
        return R.ok().put("data",pageInfo);

    }

    /*
    * 后台砍价商品添加表
    * */
    @RequestMapping("addBargainItem")
    public R addBargainItem(@RequestBody BargainGoodsEntity bargainGoodsEntity) throws ParseException {
        return bargainGoodsService.addBargainItem(bargainGoodsEntity);
    }

}
